﻿using Microsoft.EntityFrameworkCore;

namespace Devonline.AspNetCore;

/// <summary>
/// 数据带附件及附加信息的基础数据服务
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
/// <typeparam name="TEntitySet">业务数据类型</typeparam>
/// <typeparam name="TAttachment">附件数据类型</typeparam>
/// <typeparam name="TAdditional">附加信息数据类型</typeparam>
/// <typeparam name="TKey">主键类型</typeparam>
public interface IDataWithAttachmentAndAdditionalService<TDbContext, TEntitySet, TAttachment, TAdditional, TKey> :
    IDataWithAttachmentService<TDbContext, TEntitySet, TAttachment, TKey>,
    IDataWithAdditionalService<TDbContext, TEntitySet, TAdditional, TKey>,
    IAttachmentService<TDbContext, TAttachment, TKey>,
    IDataService<TDbContext, TEntitySet, TKey>
    where TDbContext : DbContext
    where TEntitySet : class, IEntitySet<TKey>
    where TAttachment : class, IAttachment<TKey>
    where TAdditional : class, IAdditional<TKey>
    where TKey : IConvertible
{ }

/// <summary>
/// 数据带附件及附加信息的基础数据服务
/// 字符串作为主键的默认实现
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
/// <typeparam name="TEntitySet">业务数据类型</typeparam>
/// <typeparam name="TAdditional">附加信息数据类型</typeparam>
public interface IDataWithAttachmentAndAdditionalService<TDbContext, TEntitySet, TAdditional> :
    IDataWithAttachmentAndAdditionalService<TDbContext, TEntitySet, Attachment, TAdditional, string>,
    IDataWithAttachmentService<TDbContext, TEntitySet>,
    IDataWithAdditionalService<TDbContext, TEntitySet, TAdditional>,
    IAttachmentService<TDbContext>,
    IDataService<TDbContext, TEntitySet>
    where TDbContext : DbContext
    where TEntitySet : class, IEntitySet<string>
    where TAdditional : class, IAdditional<string>
{ }